﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;
using VMExplorer.Dynamic;

namespace VMExplorer.MemoryObjects
{
	class GenericMemoryObject : IMemoryObject
  {
    #region Construction

    protected GenericMemoryObject (SafeProcessHandle hProcess, MemoryAddress baseAddress, string name, RegionUsage usage)
		{
      ProcessHandle = hProcess;
			BaseAddress = baseAddress;
			Name = name;
			Type = usage;
			Stats = new MemoryObjectStats (this);
      Ranges = new List<RegionInfo> ();
    }

    #endregion
    #region IMemoryObject Members

    [Browsable(false)]
    public SafeProcessHandle ProcessHandle { get; private set; }
    [Browsable(false)]
    public string Name { get; set; }
    [Browsable(false)]
    public RegionUsage Type { get; private set; }
    [Browsable(false)]
    public MemoryAddress BaseAddress { get; private set; }
    [Browsable(false)]
    public List<RegionInfo> Ranges { get; private set; }
    [Browsable(false)]
    public MemoryObjectStats Stats { get; private set; }
		[Browsable (false)]
		public virtual TabPage [] Tabs { get { return null; } }
		[Browsable (false)]
		public object ViewableStruct { get { return new FieldsToProperties(this); } }

    #endregion
  }
}
